<?php
require('config.php');

        $mobile=$_REQUEST['mobile'];
        $pwd=$_REQUEST['pwd'];
		$sql="select * from `".$oto."_users` where `userPhone`='".$mobile."' and userFlag='1' LIMIT 1";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$cha_mobile[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(!isset($cha_mobile))
		{
			$data[0]['pan']=-1;
		}
		else
		{
			$sjs=$cha_mobile[0]['loginSecret'];
			$userId=$cha_mobile[0]['userId'];
			$pwd=md5($pwd.$sjs);
            $sql="update ".$oto."_users set loginPwd='{$pwd}' where userId='{$userId}'";
			$result=$db->query($sql);
            if($result)
            {
            	$data[0]['pan']=1;
            }
            else $data[0]['pan']=2;
		}
		echo json_encode($data);
?>